<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>余额提现</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__CDN__/assets/vvptd/setting/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="__CDN__/assets/vvptd/setting/css/iconfont.css" />
		<link rel="stylesheet" href="__CDN__/assets/vvptd/setting/css/clear.border.css" />
		<link href="__CDN__/assets/vvptd/setting/css/style.css" rel="stylesheet" />
        <link rel="stylesheet" type="text/css" href="__CDN__/assets/vvptd/layer/need/layer.css"/>
        <script src="__CDN__/assets/vvptd/layer/layer.js"></script>
		
		<style type="text/css">
			ul{
				margin: 0;
			}
			p{margin: 0;}
			.mui-input-row label~input, .mui-input-row label~select, .mui-input-row label~textarea{
				font-size: 16px;
				width: calc(100% - 110px);
			}
			.mui-input-row label{
				width: 110px;
			}
			.card a{
				display: block;
				float: left;
				font-size: 16px;
				color: #858585;
				width: calc(100% - 110px);
				line-height: 40px;
			}
			.card .mui-icon-arrowright{
				margin-top: 8px;
				margin-right: 6px;
			}
			.card .name{
				margin-right: 10px;
			}
			.mui-table-view-cell{
				color: #333;
			}
			.mui-table-view-cell .name{
				margin-right: 10px;
			}
			.mui-popover .mui-table-view{
				max-height: 100%;
			}
			.mui-popover .mui-table-view{
				background: #fff;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">余额提现</h1>
		</header>
		
		<div class="mui-content cash-main">
			<div class="top">
				<ul class="mui-table-view o-h">
					<li class="mui-table-view-cell">
						<p class="p1">可提现金额 (元)</p>
						<p class="p2">（最低为50元的整数）</p>
					</li>
					<li class="mui-table-view-cell li2">
						<div class="border"></div>
					</li>
					<li class="mui-table-view-cell li1">
						{$money}元
					</li>
				</ul>
			</div>
			<div class="hui-bg"></div>
			<div class="btm">
				<div class="mui-input-row">
					<label>提现金额</label>
					<input type="text" class="mui-input-clear" id="money"  placeholder="请输入提现金额">
				</div>
				<div class="mui-input-row">
					<label>手机号</label>
					<input type="text" class="mui-input-clear" id="mobile" placeholder="请输入手机号">
				</div>
				<div class="mui-input-row">
					<label>银行卡</label>
					<div class="card">
						<a id="card" href="#bankC" >
							<span class="name">请选择提现账号</span>
							<span class="num"></span>
                            <input type="hidden" id="a_id">
							<i class="mui-icon mui-icon-arrowright f-r"></i>
						</a>
					</div>
				</div>
			</div>
		
			<p class="tishi">注：提现金额将在1-2个工作日内到账</p>
			<button type="button" class="mui-btn mui-btn-block subdata">确 定 提 现</button>
		
			<!-- 银行卡列表 -->
			<div id="bankC" class="mui-popover mui-popover-action mui-popover-bottom">
				
				<ul class="mui-table-view">
                    {foreach name="data" item="vo"}
					<li class="mui-table-view-cell">
						<span class="name">{$vo['bank_name']}</span>
						<span class="num">{$vo['bank_card']}</span>
                        <input type="hidden" id="id" value="{$vo['id']}">
					</li>
                    {/foreach}
					<!--<li class="mui-table-view-cell">-->
						<!--<span class="name">建设银行</span>-->
						<!--<span class="num">0000****0002</span>-->
					<!--</li>-->
					<!--<li class="mui-table-view-cell">-->
						<!--<span class="name">中国银行</span>-->
						<!--<span class="num">0000****0003</span>-->
					<!--</li>-->
					<!--<li class="mui-table-view-cell">-->
						<!--<span class="name">民生银行</span>-->
						<!--<span class="num">0000****0004</span>-->
					<!--</li>-->
				</ul>
				<ul class="mui-table-view">
					<li class="mui-table-view-cell">
						<a href="#picture"><b>取 消</b></a>
					</li>
				</ul>
			</div>
		</div>
		
		<script src="__CDN__/assets/vvptd/setting/js/jquery.min.js"></script>
		<script src="__CDN__/assets/vvptd/setting/js/mui.min.js"></script>
		<script type="text/javascript">
			$(".mui-popover-action li").on('tap',function(){
				var name = $(this).find('.name').text();
				var num = $(this).find('.num').text();
                var id = $(this).find('#id').val();
				$("#card .name").text(name);
				$("#card .num").text(num);
                $("#a_id").val(id);
				//关闭actionsheet
				mui('#bankC').popover('toggle');
			})
            $('.subdata').on('click',function(){
                var money = $('#money').val();
                var mobile = $('#mobile').val();
                var id = $('#a_id').val();
                mui.ajax('/vvptd/member/putForward',{
                    type:'post',
                    data:{
                        money:money,
                        mobile:mobile,
                        account:id
                    },
                    success: function (data) {
                        if(data.code == 1){
                            layer.open({
                                content:data.msg
                                , skin: 'msg'
                                , time: 2 //2秒后自动关闭

                            });
                            setTimeout(function(){
                                location.href='';
                            },500);
                        }else{
                            layer.open({
                                content:data.msg
                                , skin: 'msg'
                                , time: 2 //2秒后自动关闭

                            });
                        }
                    },
                    error: function (data) {
                        layer.open({
                            content:'网络繁忙'
                            , skin: 'msg'
                            , time: 2 //2秒后自动关闭

                        });
                    }
                })
            })
		</script>
	</body>

</html>